#ifndef COONSPOLYNOM
#define COONSPOLYNOM

#include <cmath>

class coonsPolynom {

public:

  static float compute(int control_point, float t) {
    switch (control_point) {
      case 0:  return pow(1.0 - t, 3.0) / 6.0;
      case 1:  return (3.0 * t * t * t - 6.0 * t * t + 4.0) / 6.0;
      case 2:  return (-3.0 * t * t * t + 3.0 * t * t + 3.0 * t + 1) / 6.0;
      case 3:  return (t * t * t) / 6.0;
      default: return 0.0;
    }
  }
};

#endif